<?php

use think\Facade\Route;
use think\Facade\Env;

Route::domain(Env::get('app.api_url'), function () {
    header("Access-Control-Allow-Origin: *");
    header('Access-Control-Allow-Methods: POST, PUT, GET, OPTIONS, DELETE, HEAD, PATCH');
    header("Access-Control-Allow-Headers: token,tokens,language, Origin, X-Requested-With, Content-Type, Accept");
    Route::miss(function () {
        $result = [
            'code' => 1,
            'msg'  => '接口不存在',
            'time' => time(),
            'data' => [],
        ];
        return json($result);
        exit();
    });

    Route::group('Other', function () {
        Route::rule('list', '/list'); //获取定位信息
        Route::rule('list_ks', '/list_ks'); //获取定位信息
        Route::rule('test', '/test'); //获取定位信息
        Route::rule('testAddCustomer', '/testAddCustomer'); //获取定位信息
    })->prefix('Other');
})->bind('api')->prefix('api');
